package com.example.parkdemo.adapter

import android.view.View
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.user.RepairBeanItem
import com.example.parkdemo.R

class RepairAdapter : BaseQuickAdapter<RepairBeanItem, BaseViewHolder>(R.layout.item_repait) {
    override fun convert(holder: BaseViewHolder, item: RepairBeanItem) {
        holder.setText(R.id.item_repair_id_tv, "维修id:${item.repairId}")
        holder.setText(R.id.item_repair_time_tv, "维修时间:${item.repairTime}")
        holder.setText(R.id.item_repair_desc_tv, "维修描述:${item.repairDescribe}")
        val view = holder.getView<ImageView>(R.id.item_repair_select_iv)
        if (item.isShow) {
            view.visibility = View.VISIBLE
        } else {
            view.visibility = View.GONE
        }
        if (item.isSelected) {
            view.setImageResource(R.drawable.gou)
        } else {
            view.setImageResource(R.drawable.gou_default)
        }

    }
}